package com.project.mapper;

import com.project.bean.LogBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ILogMapper {
    /**
     * 添加日志
     * @param logBean 日志对象
     */
    @Insert("insert into t_log(l_date,l_info) values (#{date},#{info})")
    public void add(LogBean logBean);

    /**
     * 按时间查询日志
     * @param startDate 起始日期
     * @param endDate 结束日期
     * @return 日志集合
     */
    public List<LogBean> findByDate(@Param("startDate") LocalDate startDate,
                                    @Param("endDate") LocalDate endDate);
}
